package com.top.mall.main.mine

import android.app.Activity
import android.content.Intent
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.SPStaticUtils
import com.module.lemlin.owner.OwnerViewModeActivity
import com.top.mall.R
import com.top.mall.jetpack.vm.CouponViewModel
import com.top.mall.main.access.AccessActivity
import com.top.mall.popup.ExitLoginPopup
import com.top.mall.popup.MineServicePopup
import kotlinx.android.synthetic.main.activity_mine_setting.*
import kotlinx.android.synthetic.main.activity_mine_setting.imageViewBack

class MineSettingActivity : OwnerViewModeActivity<CouponViewModel>() {

    companion object {
        fun open(activity: Activity) {
            val intent = Intent(activity, MineSettingActivity::class.java)
            activity.startActivity(intent)
        }
    }


    override fun viewModel(): CouponViewModel {
        return createViewModel()
    }

    override val layoutResId: Int
        get() = R.layout.activity_mine_setting

    override fun stateBar(): StatusBar {
        return StatusBar(view = flMineSettingBar)
    }

    override fun initView() {

        imageViewBack.setOnClickListener { finish() }
        //我是便利店主
        tvSettingShopOwner.setOnClickListener {

        }
        //我是货车主
        tvSettingTruckOwner.setOnClickListener {

        }
        //我是便利店员
        tvSettingShopStaff.setOnClickListener {

        }
        //语言
        flSettingLanguage.setOnClickListener {

        }
        //账号和安全
        flSettingAccount.setOnClickListener {

        }
        //去Google评价软件
        tvSettingGoogle.setOnClickListener {

        }
        //清除缓存
        flSettingCache.setOnClickListener {

        }
        //关于
        tvSettingAbout.setOnClickListener {
            MineRichTextActivity.openApi("关于公司","about")
        }
        //退出登录
        tvSettingExit.setOnClickListener {
            mExitLoginPopup.showPopupWindow()
        }
    }


    private val mExitLoginPopup: ExitLoginPopup by lazy {
        ExitLoginPopup(this) {
            SPStaticUtils.clear()
            ActivityUtils.finishAllActivities()
            AccessActivity.open()
        }
    }

    override fun initData() {

    }

    private fun fillData() {
        ckSettingRemind.isChecked = false //消息提醒
        tvSettingLanguage.text = ""       //语言
        tvSettingAccount.text = ""        //账户和安全
        tvSettingCache.text = ""          //缓存
    }

}